package com.tmt.jpa.jpaservice.impl;


import com.tmt.jpa.jpaservice.ITmtBaseRepo;
import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;

import javax.persistence.EntityManager;
import java.io.Serializable;

/**
 * Created by ThreeManTeam on 2017/5/15.
 */
public class TmtBaseRepoImpl<T, ID extends Serializable> extends SimpleJpaRepository<T, ID> implements ITmtBaseRepo<T, ID> {

	private final EntityManager entityManager;
	private final JpaEntityInformation<T, ?> entityInformation;

	public TmtBaseRepoImpl(JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
		super(entityInformation, entityManager);
		this.entityInformation = entityInformation;
		this.entityManager = entityManager;
	}

	@Override
	public EntityManager getEntityManager() {
		return entityManager;
	}

}
